﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CsplCalculatorLib;
using CsplCalculatorLib.Model;

namespace CsplCalculatorMain
{
    public class Program
    {
        public static void Main(string[] args)
        {
            MainCalculator cal = new MainCalculator();
            CalModel data1 = new CalModel();
            CalModel data2 = new CalModel(CalOperations.Div);
            CalModel data3 = new CalModel();
            data3.ListOfNumber = new List<int>(){1, 2};
            data3.CalMode = CalMode.List;
            data3.Operation = CalOperations.Sub;

            data1.IntegerValue1 = 20;
            data1.IntegerValue2 = 0;
            data1.Operation = CalOperations.Div;

           // cal.Data = data1;
            cal.Data = data3;
            
            //int result = 0;
            int result1 = 0;
            try
            {
              //  result = cal.Calculate();
                result1 = cal.Calculate();

            }
            catch (Exception e)
            {

                Console.WriteLine("Error occurs : " + e.Message);
                Console.Read();
            }

            Console.WriteLine("result = "+result1);
            Console.Read();
            
        }
    }
}
